home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr49
/
pcspeed.zip
/
PCSPEED.C
next >
Wrap
Text File
|
1993-05-16
|
2KB
|
106 lines
/* Adapted from Benchmarking The Speedy PCs In C */
/* Micro Cornucopia, #29, April-May 1986 by */
/* Gary Entsminger. */
/* Three benchmarks were grouped into one with */
/* self-timing added. Descriptive comments and */
/* the changes by Neal - Sunnyvale,CA Feb '87 */
/* Compiled with DeSmet C - ver 2.51 */
main()
{
int i,j,k,l,stime,ntime,dotime,seconds;
int seconds1,seconds2,seconds3;
scr_setup();
scr_clr();
printf("\n PCSPEED VER: 1.1 - Complied with DeSmet C - ver 2.51.\n\n");
printf("Adapted from Benchmarking The Speedy PCs In C\n");
printf("Micro Cornucopia, #29, April-May 1986 \n");
printf("by Gary Entsminger.\n\n");
printf("Three benchmarks were grouped into one with\n");
printf("self-timing added. Descriptive comments and\n");
printf("the changes by L.B Neal - Sunnyvale,CA Feb '87.\n");
printf("Timing function by Tom Serface - Ticks.A.\n\n");
printf("The following three benchmarks are processor\n");
printf("intensive. #3 is more of a test of screen\n");
printf("writing efficiency.\n\n");
{
/* TEST #1 */
i=0; j=1; k=2; l=0;
stime = ticks();
for(l = 0; l < 20; ++l)
{
for(i = 0; i < 20000;++i)
{
k =((j+1))/j+i;
if ((i % 1000)==0)
{
if(l < 19) putchar('1');
else putchar('x');
}
}
}
printf("\n%d j %d k %d i\n\n",j,k,i);
ntime = ticks();
dotime = ntime - stime;
seconds1 = (dotime * 10) / 182;
}
{
/* TEST #2 */
i=0; l=0; stime=ticks();
for (l = 0; l < 20; ++l)
{
for(i = 0; i < 20000;++i)
{
if((i % 1000)==0)
{
if(l < 19) putchar('2');
else putchar('x');
}
}
}
printf("\n%d i\n\n",i);
ntime = ticks();
dotime = ntime - stime;
seconds2 = (dotime * 10) / 182;
}
{
/* TEST #3 */
i=0; stime=ticks();
for(i = 0; i < 20000;++i)
{
putchar('3');
}
printf("\n%d i\n",i);
ntime = ticks();
dotime = ntime - stime;
seconds3 = (dotime * 10) / 182;
printf("\n Test #1 took %d seconds.",seconds1);
printf(" IBM XT takes ~51 seconds.\n");
printf("\n Test #2 took %d seconds.",seconds2);
printf(" IBM XT takes ~28 seconds.\n");
printf("\n Test #3 took %d seconds.",seconds3);
printf(" IBM XT takes ~46 seconds.\n");
}
}